package cn.edu.scau.cmi.wuzhenzhou.simpleFactoryMethod;

import java.net.URL;
import java.util.ResourceBundle;

import cn.edu.scau.cmi.wuzhenzhou.simpleFactoryMethod.domain.Meat;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.layout.Pane;

public class MyController implements Initializable{
	@FXML
	private TextField field;
	@FXML
	private Label label;
	@FXML
	private TextArea view;
	
	@Override
	public void initialize(URL location, ResourceBundle resources) {
		// TODO Auto-generated method stub
		
	}
	
	public void estimate(ActionEvent event) {
		if(!field.getText().equals("beef")&&
		   !field.getText().equals("pork")&&
		   !field.getText().equals("chicken")) {
			label.setText("输入错误");
		} else {
			label.setText("输入正确");
			Meat beaf = MeatFactory.getMeat(field.getText());
			view.setText(beaf.cook());
		}
			
	}
	
	
	
	
	
	

}
